Survey questions
Q1. Before receiving this survey, did you know influenza is different from the stomach flu?
# Q1 summary
with(data2, table(Q1))
## Q1
## No Yes
## 488 1664
q1 <- data2 %>%
count(Q1)
# plot with this one
ggplot(data2[!is.na(data2$Q1), ]) + geom_bar(mapping = aes(x = Q1, fill = Q1))

# ggplot(q1, aes(x = Q1, y = n, fill = Q1)) + geom_bar(stat = 'identity')
# plot without na's
#ggplot(q1[!is.na(q1$Q1), ], aes(x = Q1, y = n, fill = Q1)) +
# geom_bar(stat = 'identity', position = position_dodge())
# by gender, PPGENDER
with(data2, table(PPGENDER, Q1))
## Q1
## PPGENDER No Yes
## Female 205 888
## Male 283 776
q1 <- data2 %>%
count(Q1, PPGENDER)
# plot
ggplot(data2[!is.na(data2$Q1), ]) + geom_bar(mapping = aes(x = Q1, fill = PPGENDER), position = position_dodge())

# ggplot(q1[!is.na(q1$Q1), ], aes(x = Q1, y = n, fill = PPGENDER)) +
# geom_bar(stat = 'identity', position = position_dodge())
# plot with facet
ggplot(q1[!is.na(q1$Q1), ], aes(x = Q1, y = n, fill = Q1)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~PPGENDER)

# by ethnicity, PPETHM
with(data2, table(PPETHM, Q1))
## Q1
## PPETHM No Yes
## 2+ Races, Non-Hispanic 18 62
## Black, Non-Hispanic 50 143
## Hispanic 69 161
## Other, Non-Hispanic 29 63
## White, Non-Hispanic 322 1235
q1 <- data2 %>%
count(Q1, PPETHM)
# plot
ggplot(q1[!is.na(q1$Q1), ], aes(x = Q1, y = n, fill = PPETHM)) +
geom_bar(stat = 'identity', position = position_dodge())

# plot with facet
ggplot(q1[!is.na(q1$Q1), ], aes(x = Q1, y = n, fill = Q1)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~PPETHM)

# by income, PPINCIMP
with(data2, table(PPINCIMP, Q1))
## Q1
## PPINCIMP No Yes
## Less than $5,000 22 30
## $5,000 to $7,499 8 16
## $7,500 to $9,999 7 7
## $10,000 to $12,499 17 39
## $12,500 to $14,999 10 38
## $15,000 to $19,999 22 40
## $20,000 to $24,999 16 55
## $25,000 to $29,999 23 76
## $30,000 to $34,999 21 70
## $35,000 to $39,999 31 72
## $40,000 to $49,999 42 107
## $50,000 to $59,999 46 137
## $60,000 to $74,999 50 172
## $75,000 to $84,999 26 133
## $85,000 to $99,999 33 120
## $100,000 to $124,999 56 269
## $125,000 to $149,999 24 108
## $150,000 to $174,999 16 68
## $175,000 or more 18 107
q1 <- data2 %>%
count(Q1, PPINCIMP)
# plot
ggplot(q1[!is.na(q1$Q1), ], aes(x = Q1, y = n, fill = PPINCIMP)) +
geom_bar(stat = 'identity', position = position_dodge())

# plot with facet
ggplot(q1[!is.na(q1$Q1), ], aes(x = Q1, y = n, fill = Q1)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~PPINCIMP)

Q2. Have you had an illness with influenza-like symptoms since August 2015?
## Q2
## No Yes
## 1735 414
q2 <- data2 %>%
count(Q2)
ggplot(q2, aes(x = Q2, y = n, fill = Q2)) + geom_bar(stat = 'identity')

# by gender
with(data2, table(Q2, PPGENDER))
## PPGENDER
## Q2 Female Male
## No 858 877
## Yes 234 180
q2 <- data2 %>%
count(Q2, PPGENDER)
ggplot(q2, aes(x = Q2, y = n, fill = PPGENDER)) +
geom_bar(stat = 'identity', position = position_dodge())

# by ethnicity
with(data2, table(Q2, PPETHM))
## PPETHM
## Q2 2+ Races, Non-Hispanic Black, Non-Hispanic Hispanic
## No 61 152 164
## Yes 19 39 65
## PPETHM
## Q2 Other, Non-Hispanic White, Non-Hispanic
## No 71 1287
## Yes 22 269
q2 <- data2 %>%
count(Q2, PPETHM)
ggplot(q2, aes(x = Q2, y = n, fill = PPETHM)) +
geom_bar(stat = 'identity', position = position_dodge())

# by income
with(data2, table(Q2, PPINCIMP))
## PPINCIMP
## Q2 Less than $5,000 $5,000 to $7,499 $7,500 to $9,999
## No 43 19 13
## Yes 9 6 1
## PPINCIMP
## Q2 $10,000 to $12,499 $12,500 to $14,999 $15,000 to $19,999
## No 38 39 46
## Yes 17 9 15
## PPINCIMP
## Q2 $20,000 to $24,999 $25,000 to $29,999 $30,000 to $34,999
## No 55 79 74
## Yes 17 19 18
## PPINCIMP
## Q2 $35,000 to $39,999 $40,000 to $49,999 $50,000 to $59,999
## No 85 121 155
## Yes 18 27 27
## PPINCIMP
## Q2 $60,000 to $74,999 $75,000 to $84,999 $85,000 to $99,999
## No 172 130 123
## Yes 50 29 29
## PPINCIMP
## Q2 $100,000 to $124,999 $125,000 to $149,999 $150,000 to $174,999
## No 265 112 62
## Yes 61 20 21
## PPINCIMP
## Q2 $175,000 or more
## No 104
## Yes 21
q2 <- data2 %>%
count(Q2, PPINCIMP)
ggplot(q2, aes(x = Q2, y = n, fill = PPINCIMP)) +
geom_bar(stat = 'identity', position = position_dodge())

Q3. Has any other person in your household had an illness with influenza like symptoms since August 2015?
# all
with(data2, table(Q3))
## Q3
## Don_t know No Yes
## 161 1608 383
q3 <- data2 %>%
count(Q3)
ggplot(q3, aes(x = Q3, y = n, fill = Q3)) + geom_bar(stat = 'identity')

# by gender
with(data2, table(Q3, PPGENDER))
## PPGENDER
## Q3 Female Male
## Don_t know 72 89
## No 804 804
## Yes 217 166
q3 <- data2 %>%
count(Q3, PPGENDER)
ggplot(q3, aes(x = Q3, y = n, fill = PPGENDER)) +
geom_bar(stat = 'identity', position = position_dodge())

# by ethnicity
with(data2, table(Q3, PPETHM))
## PPETHM
## Q3 2+ Races, Non-Hispanic Black, Non-Hispanic Hispanic
## Don_t know 6 19 30
## No 57 149 146
## Yes 17 25 53
## PPETHM
## Q3 Other, Non-Hispanic White, Non-Hispanic
## Don_t know 11 95
## No 59 1197
## Yes 23 265
q3 <- data2 %>%
count(Q3, PPETHM)
ggplot(q3, aes(x = Q3, y = n, fill = PPETHM)) +
geom_bar(stat = 'identity', position = position_dodge())

# by income
with(data2, table(Q3, PPINCIMP))
## PPINCIMP
## Q3 Less than $5,000 $5,000 to $7,499 $7,500 to $9,999
## Don_t know 11 6 1
## No 36 18 13
## Yes 5 1 0
## PPINCIMP
## Q3 $10,000 to $12,499 $12,500 to $14,999 $15,000 to $19,999
## Don_t know 4 7 7
## No 44 30 47
## Yes 8 11 8
## PPINCIMP
## Q3 $20,000 to $24,999 $25,000 to $29,999 $30,000 to $34,999
## Don_t know 8 4 11
## No 52 81 70
## Yes 12 13 9
## PPINCIMP
## Q3 $35,000 to $39,999 $40,000 to $49,999 $50,000 to $59,999
## Don_t know 11 6 13
## No 75 117 136
## Yes 17 25 33
## PPINCIMP
## Q3 $60,000 to $74,999 $75,000 to $84,999 $85,000 to $99,999
## Don_t know 18 7 11
## No 165 120 107
## Yes 39 33 35
## PPINCIMP
## Q3 $100,000 to $124,999 $125,000 to $149,999
## Don_t know 20 6
## No 245 100
## Yes 61 26
## PPINCIMP
## Q3 $150,000 to $174,999 $175,000 or more
## Don_t know 3 7
## No 58 94
## Yes 23 24
q3 <- data2 %>%
count(Q3, PPINCIMP)
ggplot(q3, aes(x = Q3, y = n, fill = PPINCIMP)) +
geom_bar(stat = 'identity', position = position_dodge())

Q4. Does your job require you to have a lot of contact with the public?
# all
with(data2, table(Q4))
## Q4
## No, I don_t work
## 779
## No, my job does not require much contact with the public
## 620
## Yes
## 751
(
q4 <- data2 %>%
count(Q4)
)
## Source: local data frame [4 x 2]
##
## Q4 n
## <chr> <int>
## 1 No, I don_t work 779
## 2 No, my job does not require much contact with the public 620
## 3 Yes 751
## 4 NA 18
ggplot(q4, aes(x = Q4, y = n, fill = Q4)) + geom_bar(stat = 'identity') +
theme(axis.text.x = element_text(angle = 45, hjust = 1))

# by gender
with(data2, table(Q4, PPGENDER))
## PPGENDER
## Q4 Female Male
## No, I don_t work 430 349
## No, my job does not require much contact with the public 263 357
## Yes 400 351
q4 <- data2 %>%
count(Q4, PPGENDER)
ggplot(q4, aes(x = Q4, y = n, fill = PPGENDER)) +
geom_bar(stat = 'identity', position = position_dodge()) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))

# by ethnicity
with(data2, table(Q4, PPETHM))
## PPETHM
## Q4 2+ Races, Non-Hispanic
## No, I don_t work 30
## No, my job does not require much contact with the public 23
## Yes 27
## PPETHM
## Q4 Black, Non-Hispanic
## No, I don_t work 69
## No, my job does not require much contact with the public 59
## Yes 64
## PPETHM
## Q4 Hispanic
## No, I don_t work 69
## No, my job does not require much contact with the public 72
## Yes 87
## PPETHM
## Q4 Other, Non-Hispanic
## No, I don_t work 24
## No, my job does not require much contact with the public 34
## Yes 35
## PPETHM
## Q4 White, Non-Hispanic
## No, I don_t work 587
## No, my job does not require much contact with the public 432
## Yes 538
q4 <- data2 %>%
count(Q4, PPETHM)
ggplot(q4, aes(x = Q4, y = n, fill = PPETHM)) +
geom_bar(stat = 'identity', position = position_dodge()) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))

# by income
with(data2, table(Q4, PPINCIMP))
## PPINCIMP
## Q4 Less than $5,000
## No, I don_t work 29
## No, my job does not require much contact with the public 17
## Yes 6
## PPINCIMP
## Q4 $5,000 to $7,499
## No, I don_t work 15
## No, my job does not require much contact with the public 5
## Yes 5
## PPINCIMP
## Q4 $7,500 to $9,999
## No, I don_t work 11
## No, my job does not require much contact with the public 1
## Yes 2
## PPINCIMP
## Q4 $10,000 to $12,499
## No, I don_t work 33
## No, my job does not require much contact with the public 7
## Yes 15
## PPINCIMP
## Q4 $12,500 to $14,999
## No, I don_t work 32
## No, my job does not require much contact with the public 5
## Yes 11
## PPINCIMP
## Q4 $15,000 to $19,999
## No, I don_t work 28
## No, my job does not require much contact with the public 13
## Yes 21
## PPINCIMP
## Q4 $20,000 to $24,999
## No, I don_t work 35
## No, my job does not require much contact with the public 18
## Yes 19
## PPINCIMP
## Q4 $25,000 to $29,999
## No, I don_t work 46
## No, my job does not require much contact with the public 15
## Yes 37
## PPINCIMP
## Q4 $30,000 to $34,999
## No, I don_t work 38
## No, my job does not require much contact with the public 25
## Yes 29
## PPINCIMP
## Q4 $35,000 to $39,999
## No, I don_t work 42
## No, my job does not require much contact with the public 22
## Yes 39
## PPINCIMP
## Q4 $40,000 to $49,999
## No, I don_t work 64
## No, my job does not require much contact with the public 41
## Yes 43
## PPINCIMP
## Q4 $50,000 to $59,999
## No, I don_t work 60
## No, my job does not require much contact with the public 58
## Yes 63
## PPINCIMP
## Q4 $60,000 to $74,999
## No, I don_t work 73
## No, my job does not require much contact with the public 60
## Yes 88
## PPINCIMP
## Q4 $75,000 to $84,999
## No, I don_t work 45
## No, my job does not require much contact with the public 51
## Yes 64
## PPINCIMP
## Q4 $85,000 to $99,999
## No, I don_t work 47
## No, my job does not require much contact with the public 48
## Yes 58
## PPINCIMP
## Q4 $100,000 to $124,999
## No, I don_t work 87
## No, my job does not require much contact with the public 111
## Yes 127
## PPINCIMP
## Q4 $125,000 to $149,999
## No, I don_t work 39
## No, my job does not require much contact with the public 51
## Yes 42
## PPINCIMP
## Q4 $150,000 to $174,999
## No, I don_t work 23
## No, my job does not require much contact with the public 25
## Yes 36
## PPINCIMP
## Q4 $175,000 or more
## No, I don_t work 32
## No, my job does not require much contact with the public 47
## Yes 46
q4 <- data2 %>%
count(Q4, PPINCIMP)
ggplot(q4, aes(x = Q4, y = n, fill = PPINCIMP)) +
geom_bar(stat = 'identity', position = position_dodge()) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))

Q5. Do you have a car that you can use to travel to work?
# all
with(data2, table(Q5))
## Q5
## No Yes
## 133 1235
q5 <- data2 %>%
count(Q5)
ggplot(q5, aes(x = Q5, y = n, fill = Q5)) + geom_bar(stat = 'identity')

# by gender
with(data2, table(PPGENDER, Q5))
## Q5
## PPGENDER No Yes
## Female 70 592
## Male 63 643
q5 <- data2 %>%
count(Q5, PPGENDER)
ggplot(q5, aes(x = Q5, y = n, fill = PPGENDER)) +
geom_bar(stat = 'identity', position = position_dodge())

# by ethnicity
q5 <- data2 %>%
count(Q5, PPETHM)
ggplot(q5, aes(x = Q5, y = n, fill = PPETHM)) +
geom_bar(stat = 'identity', position = position_dodge())

# by income
q5 <- data2 %>%
count(Q5, PPINCIMP)
ggplot(q5, aes(x = Q5, y = n, fill = PPINCIMP)) +
geom_bar(stat = 'identity', position = position_dodge())

Q6. Do you regularly use public transportation?
# all
with(data2, table(Q6))
## Q6
## No Yes
## 1959 194
q6 <- data2 %>%
count(Q6)
ggplot(q6, aes(x = Q6, y = n, fill = Q6)) + geom_bar(stat = 'identity')

# by gender
# with(data2, table(PPGENDER, Q6))
(q6 <- data2 %>%
count(Q6, PPGENDER)
)
## Source: local data frame [6 x 3]
## Groups: Q6 [?]
##
## Q6 PPGENDER n
## (chr) (chr) (int)
## 1 No Female 998
## 2 No Male 961
## 3 Yes Female 96
## 4 Yes Male 98
## 5 NA Female 3
## 6 NA Male 12
ggplot(q6, aes(x = Q6, y = n, fill = PPGENDER)) +
geom_bar(stat = 'identity', position = position_dodge())

# by ethnicity
(q6 <- data2 %>%
count(Q6, PPETHM)
)
## Source: local data frame [13 x 3]
## Groups: Q6 [?]
##
## Q6 PPETHM n
## (chr) (chr) (int)
## 1 No 2+ Races, Non-Hispanic 62
## 2 No Black, Non-Hispanic 158
## 3 No Hispanic 196
## 4 No Other, Non-Hispanic 80
## 5 No White, Non-Hispanic 1463
## 6 Yes 2+ Races, Non-Hispanic 18
## 7 Yes Black, Non-Hispanic 36
## 8 Yes Hispanic 32
## 9 Yes Other, Non-Hispanic 13
## 10 Yes White, Non-Hispanic 95
## 11 NA Black, Non-Hispanic 1
## 12 NA Hispanic 4
## 13 NA White, Non-Hispanic 10
ggplot(q6, aes(x = Q6, y = n, fill = PPETHM)) +
geom_bar(stat = 'identity', position = position_dodge())

# by income
(q6 <- data2 %>%
count(Q6, PPINCIMP)
)
## Source: local data frame [50 x 3]
## Groups: Q6 [?]
##
## Q6 PPINCIMP n
## (chr) (fctr) (int)
## 1 No Less than $5,000 42
## 2 No $5,000 to $7,499 22
## 3 No $7,500 to $9,999 10
## 4 No $10,000 to $12,499 47
## 5 No $12,500 to $14,999 42
## 6 No $15,000 to $19,999 58
## 7 No $20,000 to $24,999 64
## 8 No $25,000 to $29,999 90
## 9 No $30,000 to $34,999 85
## 10 No $35,000 to $39,999 92
## .. ... ... ...
ggplot(q6, aes(x = Q6, y = n, fill = PPINCIMP)) +
geom_bar(stat = 'identity', position = position_dodge())

Q7. What types of public transportation do you regularly use?
Q7 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, Q7_1_Bus:Q7_otherText) %>%
gather("q", "r", Q7_1_Bus:Q7_7_Other)
# Q7
with(Q7, table(q, r))
## r
## q No Yes
## Q7_1_Bus 57 137
## Q7_2_Carpool 184 10
## Q7_3_Subway 131 63
## Q7_4_Train 139 55
## Q7_5_Taxi 169 25
## Q7_6_Airplane 175 19
## Q7_7_Other 179 15
q7 <- Q7 %>%
count(q, r)
# flip coordinates
ggplot(q7[!is.na(q7$r), ], aes(x = r, y = n, fill = r)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~q) + coord_flip()

# by gender
# with(Q7, table(PPGENDER, r, q))
(q7 <- Q7 %>%
group_by(PPGENDER, q, r) %>%
count(PPGENDER, q, r)
)
## Source: local data frame [42 x 4]
## Groups: PPGENDER, q [?]
##
## PPGENDER q r n
## (chr) (chr) (chr) (int)
## 1 Female Q7_1_Bus No 27
## 2 Female Q7_1_Bus Yes 69
## 3 Female Q7_1_Bus NA 1001
## 4 Female Q7_2_Carpool No 91
## 5 Female Q7_2_Carpool Yes 5
## 6 Female Q7_2_Carpool NA 1001
## 7 Female Q7_3_Subway No 68
## 8 Female Q7_3_Subway Yes 28
## 9 Female Q7_3_Subway NA 1001
## 10 Female Q7_4_Train No 75
## .. ... ... ... ...
ggplot(q7[!is.na(q7$r), ], aes(x = r, y = n, fill = PPGENDER)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~q)

# by ethnicity
# with(Q7, table(PPETHM, r, q))
(q7 <- Q7 %>%
group_by(PPETHM, q, r) %>%
count(PPETHM, q, r)
)
## Source: local data frame [100 x 4]
## Groups: PPETHM, q [?]
##
## PPETHM q r n
## (chr) (chr) (chr) (int)
## 1 2+ Races, Non-Hispanic Q7_1_Bus No 4
## 2 2+ Races, Non-Hispanic Q7_1_Bus Yes 14
## 3 2+ Races, Non-Hispanic Q7_1_Bus NA 62
## 4 2+ Races, Non-Hispanic Q7_2_Carpool No 18
## 5 2+ Races, Non-Hispanic Q7_2_Carpool NA 62
## 6 2+ Races, Non-Hispanic Q7_3_Subway No 12
## 7 2+ Races, Non-Hispanic Q7_3_Subway Yes 6
## 8 2+ Races, Non-Hispanic Q7_3_Subway NA 62
## 9 2+ Races, Non-Hispanic Q7_4_Train No 15
## 10 2+ Races, Non-Hispanic Q7_4_Train Yes 3
## .. ... ... ... ...
ggplot(q7[!is.na(q7$r), ], aes(x = r, y = n, fill = PPETHM)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~q)

# by income
# with(Q7, table(q, r, PPINCIMP))
(q7 <- Q7 %>%
group_by(PPINCIMP, q, r) %>%
count(PPINCIMP, q, r)
)
## Source: local data frame [357 x 4]
## Groups: PPINCIMP, q [?]
##
## PPINCIMP q r n
## (fctr) (chr) (chr) (int)
## 1 Less than $5,000 Q7_1_Bus Yes 10
## 2 Less than $5,000 Q7_1_Bus NA 43
## 3 Less than $5,000 Q7_2_Carpool No 10
## 4 Less than $5,000 Q7_2_Carpool NA 43
## 5 Less than $5,000 Q7_3_Subway No 9
## 6 Less than $5,000 Q7_3_Subway Yes 1
## 7 Less than $5,000 Q7_3_Subway NA 43
## 8 Less than $5,000 Q7_4_Train No 8
## 9 Less than $5,000 Q7_4_Train Yes 2
## 10 Less than $5,000 Q7_4_Train NA 43
## .. ... ... ... ...
ggplot(q7[!is.na(q7$r), ], aes(x = r, y = n, fill = PPINCIMP)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~q)

Q8. For what types of activities do you regularly use public transportation?
Q8 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, Q8_1_Work:Q8_otherText) %>%
gather("q", "r", Q8_1_Work:Q8_6_Other)
with(Q8, table(q, r))
## r
## q No Yes
## Q8_1_Work 89 105
## Q8_2_School 158 36
## Q8_3_Shopping 107 87
## Q8_4_Visiting people 125 69
## Q8_5_Recreation 127 67
## Q8_6_Other 175 19
Q9. Do other members of your household regularly use public transportation?
## Q9
## Don_t know No Yes
## 32 1935 183
Q10. What types of public transportation do other members of your household regularly use?
Q10 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, Q10_1_Bus:Q10_9_Refused) %>%
gather("q", "r", Q10_1_Bus:Q10_8_Other)
with(Q10, table(q, r))
## r
## q No Yes
## Q10_1_Bus 48 135
## Q10_2_Carpool 166 17
## Q10_3_Subway 130 53
## Q10_4_Train 137 46
## Q10_5_Taxi 157 26
## Q10_6_Airplane 164 19
## Q10_7_Don_t know 182 1
## Q10_8_Other 172 11
q10 <- Q10 %>%
count(q, r)
Q11. How do you rate your risk of getting influenza if you visited each of the following locations?
Q11 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, Q11_1_Work:Q11_OtherText_Codes) %>%
gather("q", "r", Q11_1_Work:Q11_11_Other)
# all
with(Q11, table(q, r))
## r
## q Don_t Know High Risk, Very Likely
## Q11_1_Work 185 524
## Q11_10_Family or friends 121 541
## Q11_11_Other 915 51
## Q11_2_Schools 178 909
## Q11_3_Day care 214 924
## Q11_4_Stores 115 551
## Q11_5_Restaurants 111 483
## Q11_6_Libraries 169 386
## Q11_7_Hospitals 123 982
## Q11_8_Doctor_s office 110 994
## Q11_9_Public transportation 147 1093
## r
## q Low Risk, Not Likely
## Q11_1_Work 643
## Q11_10_Family or friends 485
## Q11_11_Other 104
## Q11_2_Schools 508
## Q11_3_Day care 554
## Q11_4_Stores 405
## Q11_5_Restaurants 442
## Q11_6_Libraries 700
## Q11_7_Hospitals 374
## Q11_8_Doctor_s office 308
## Q11_9_Public transportation 353
## r
## q Medium Risk, Somewhat Likely
## Q11_1_Work 795
## Q11_10_Family or friends 1000
## Q11_11_Other 54
## Q11_2_Schools 551
## Q11_3_Day care 454
## Q11_4_Stores 1076
## Q11_5_Restaurants 1111
## Q11_6_Libraries 890
## Q11_7_Hospitals 669
## Q11_8_Doctor_s office 733
## Q11_9_Public transportation 551
q11 <- Q11 %>%
count(q, r)
ggplot(q11[!is.na(q11$r), ], aes(x = r, y = n, fill = r)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~q) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))

# by gender
# with(Q7, table(PPGENDER, r, q))
(q11 <- Q11 %>%
group_by(PPGENDER, q, r) %>%
count(PPGENDER, q, r)
)
## Source: local data frame [110 x 4]
## Groups: PPGENDER, q [?]
##
## PPGENDER q r n
## (chr) (chr) (chr) (int)
## 1 Female Q11_1_Work Don_t Know 89
## 2 Female Q11_1_Work High Risk, Very Likely 309
## 3 Female Q11_1_Work Low Risk, Not Likely 310
## 4 Female Q11_1_Work Medium Risk, Somewhat Likely 381
## 5 Female Q11_1_Work NA 8
## 6 Female Q11_10_Family or friends Don_t Know 53
## 7 Female Q11_10_Family or friends High Risk, Very Likely 302
## 8 Female Q11_10_Family or friends Low Risk, Not Likely 229
## 9 Female Q11_10_Family or friends Medium Risk, Somewhat Likely 506
## 10 Female Q11_10_Family or friends NA 7
## .. ... ... ... ...
ggplot(q11[!is.na(q11$r), ], aes(x = r, y = n, fill = PPGENDER)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~q) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))

# by ethnicity
# with(Q7, table(PPETHM, r, q))
(q11 <- Q11 %>%
group_by(PPETHM, q, r) %>%
count(PPETHM, q, r)
)
## Source: local data frame [275 x 4]
## Groups: PPETHM, q [?]
##
## PPETHM q
## (chr) (chr)
## 1 2+ Races, Non-Hispanic Q11_1_Work
## 2 2+ Races, Non-Hispanic Q11_1_Work
## 3 2+ Races, Non-Hispanic Q11_1_Work
## 4 2+ Races, Non-Hispanic Q11_1_Work
## 5 2+ Races, Non-Hispanic Q11_1_Work
## 6 2+ Races, Non-Hispanic Q11_10_Family or friends
## 7 2+ Races, Non-Hispanic Q11_10_Family or friends
## 8 2+ Races, Non-Hispanic Q11_10_Family or friends
## 9 2+ Races, Non-Hispanic Q11_10_Family or friends
## 10 2+ Races, Non-Hispanic Q11_10_Family or friends
## .. ... ...
## Variables not shown: r (chr), n (int)
ggplot(q11[!is.na(q11$r), ], aes(x = r, y = n, fill = PPETHM)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~q) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))

# by income
# with(Q7, table(q, r, PPINCIMP))
(q11 <- Q11 %>%
group_by(PPINCIMP, q, r) %>%
count(PPINCIMP, q, r)
)
## Source: local data frame [985 x 4]
## Groups: PPINCIMP, q [?]
##
## PPINCIMP q r
## (fctr) (chr) (chr)
## 1 Less than $5,000 Q11_1_Work Don_t Know
## 2 Less than $5,000 Q11_1_Work High Risk, Very Likely
## 3 Less than $5,000 Q11_1_Work Low Risk, Not Likely
## 4 Less than $5,000 Q11_1_Work Medium Risk, Somewhat Likely
## 5 Less than $5,000 Q11_1_Work NA
## 6 Less than $5,000 Q11_10_Family or friends Don_t Know
## 7 Less than $5,000 Q11_10_Family or friends High Risk, Very Likely
## 8 Less than $5,000 Q11_10_Family or friends Low Risk, Not Likely
## 9 Less than $5,000 Q11_10_Family or friends Medium Risk, Somewhat Likely
## 10 Less than $5,000 Q11_10_Family or friends NA
## .. ... ... ...
## Variables not shown: n (int)
ggplot(q11[!is.na(q11$r), ], aes(x = r, y = n, fill = PPINCIMP)) +
geom_bar(stat = 'identity', position = position_dodge()) + facet_wrap(~q) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))

Q12. Which of the following actions do you take to avoid getting sick?
Q12 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, 75:91) %>%
gather("q", "r", 7:21)
with(Q12, table(q, r))
## r
## q Always Never
## Q12_1_Avoid touching my eyes 653 324
## Q12_10_Get recommended vaccine 1041 564
## Q12_11_Take preventive medicine 425 831
## Q12_12_Cover my nose and mouth with a surgical mask 218 1568
## Q12_13_Avoid contact with people who are sick 765 153
## Q12_14_Avoid crowded places 406 413
## Q12_15_Other 91 472
## Q12_2_Avoid touching my nose 613 349
## Q12_3_Avoid touching my mouth 758 300
## Q12_4_Wash my hands with soap more often 1774 52
## Q12_5_Use hand sanitizers 911 278
## Q12_6_Clean the surfaces in my home 1132 115
## Q12_7_Clean the surfaces at work 752 544
## Q12_8_Eat nutritious food 895 107
## Q12_9_Get adequate rest 899 114
## r
## q Sometimes
## Q12_1_Avoid touching my eyes 1168
## Q12_10_Get recommended vaccine 540
## Q12_11_Take preventive medicine 890
## Q12_12_Cover my nose and mouth with a surgical mask 358
## Q12_13_Avoid contact with people who are sick 1228
## Q12_14_Avoid crowded places 1322
## Q12_15_Other 87
## Q12_2_Avoid touching my nose 1183
## Q12_3_Avoid touching my mouth 1085
## Q12_4_Wash my hands with soap more often 317
## Q12_5_Use hand sanitizers 957
## Q12_6_Clean the surfaces in my home 899
## Q12_7_Clean the surfaces at work 842
## Q12_8_Eat nutritious food 1144
## Q12_9_Get adequate rest 1130
q12 <- Q12 %>%
count(q, r)
Q13. Do you get the flu vaccine?
## Q13
## No, never Yes, every year Yes, some years
## 819 908 423
ggplot(data2[!is.na(data2$Q13), ]) + geom_bar(mapping = aes(x = Q13, fill = Q13), position = position_dodge())

Q14. How much do you pay to get an influenza vaccine?
## Q14
## $0 $30 to $60 Don_t know Less than $30 More than $60
## 970 54 80 222 4
ggplot(data2[!is.na(data2$Q14), ]) + geom_bar(mapping = aes(x = Q14, fill = Q14), position = position_dodge())

# by gender
with(data2, by(Q14, PPGENDER, summary))
## PPGENDER: Female
## $0 $30 to $60 Don_t know Less than $30 More than $60
## 514 28 41 101 2
## NA's
## 411
## --------------------------------------------------------
## PPGENDER: Male
## $0 $30 to $60 Don_t know Less than $30 More than $60
## 456 26 39 121 2
## NA's
## 427
Q15. Are you more likely to get a vaccine if others around you get a vaccine?
## Q15
## No, less likely No, no effect Yes, more likely
## 70 878 381
ggplot(data2[!is.na(data2$Q15), ]) + geom_bar(mapping = aes(x = Q15, fill = Q15), position = position_dodge())

Q16. Are you more likely to get a vaccine if others around you do not get a vaccine?
## Q16
## No, less likely No, no effect Yes, more likely
## 101 904 313
ggplot(data2[!is.na(data2$Q16), ]) + geom_bar(mapping = aes(x = Q16, fill = Q16), position = position_dodge())

Q17. Do you get a vaccine to protect yourself, protect others, or protect yourself and others?
## Q17
## Protect myself Protect myself and others
## 381 921
## Protect others
## 22
ggplot(data2[!is.na(data2$Q17), ]) + geom_bar(mapping = aes(x = Q17, fill = Q17), position = position_dodge())

Q18. What are the reasons you would not get an influenza vaccine?
Q18 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, 97:108) %>%
gather("q", "r", 7:Q18_10_Other)
with(Q18, table(q, r))
## r
## q No
## Q18_1_The vaccine costs too much 1132
## Q18_10_Other 1064
## Q18_2_The vaccine is not very effective in preventing influenza 903
## Q18_3_I am not likely to get influenza 964
## Q18_4_Do not know where to get vaccine 1199
## Q18_5_The side effect of the vaccine are too risky 958
## Q18_6_I am allergic to some of the ingredients in the vaccine 1184
## Q18_7_I do not like shots 976
## Q18_8_I just don_t get around to doing it 878
## Q18_9_I have to travel too far to get vaccine 1216
## r
## q Yes
## Q18_1_The vaccine costs too much 110
## Q18_10_Other 178
## Q18_2_The vaccine is not very effective in preventing influenza 339
## Q18_3_I am not likely to get influenza 278
## Q18_4_Do not know where to get vaccine 43
## Q18_5_The side effect of the vaccine are too risky 284
## Q18_6_I am allergic to some of the ingredients in the vaccine 58
## Q18_7_I do not like shots 266
## Q18_8_I just don_t get around to doing it 364
## Q18_9_I have to travel too far to get vaccine 26
q18 <- Q18 %>%
count(q, r)
Q19. Do you have health insurance?
## Q19
## No Yes
## 154 1994
ggplot(data2[!is.na(data2$Q19), ]) + geom_bar(mapping = aes(x = Q19, fill = Q19), position = position_dodge())

Q20. How effective do you think the influenza vaccine is in protecting people from becoming sick with influenza?
## Q20
## Don_t know It varies from season to season
## 228 433
## Not effective Somewhat effective
## 144 961
## Very effective
## 383
ggplot(data2[!is.na(data2$Q20), ]) + geom_bar(mapping = aes(x = Q20, fill = Q20), position = position_dodge())

Q21. Are influenza vaccines covered by your health insurance?
## Q21
## Don_t know
## 500
## No
## 55
## Yes, but only part of the cost is paid
## 153
## Yes, the full cost is paid
## 1282
ggplot(data2[!is.na(data2$Q21), ]) + geom_bar(mapping = aes(x = Q21, fill = Q21), position = position_dodge())

Q22. Do you do any of the following when you have influenza symptoms?
Q22 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, 112:122) %>%
gather("q", "r", 7:Q22_9_Other)
with(Q22, table(q, r))
## r
## q Always
## Q22_1_Go to a doctor_s office or medical clinic 349
## Q22_2_Decide on treatment without consulting a health practitioner 335
## Q22_3_Search the internet for a treatment 126
## Q22_4_Get adequate sleep 1147
## Q22_5_Eat nutritious food 909
## Q22_6_Take-over-counter medication for symptoms 796
## Q22_7_Take an antiviral medicine 153
## Q22_8_Take no action to treat the illness 96
## Q22_9_Other 54
## r
## q Never
## Q22_1_Go to a doctor_s office or medical clinic 552
## Q22_2_Decide on treatment without consulting a health practitioner 473
## Q22_3_Search the internet for a treatment 1148
## Q22_4_Get adequate sleep 115
## Q22_5_Eat nutritious food 135
## Q22_6_Take-over-counter medication for symptoms 210
## Q22_7_Take an antiviral medicine 1103
## Q22_8_Take no action to treat the illness 1199
## Q22_9_Other 448
## r
## q Sometimes
## Q22_1_Go to a doctor_s office or medical clinic 1235
## Q22_2_Decide on treatment without consulting a health practitioner 1329
## Q22_3_Search the internet for a treatment 861
## Q22_4_Get adequate sleep 875
## Q22_5_Eat nutritious food 1091
## Q22_6_Take-over-counter medication for symptoms 1130
## Q22_7_Take an antiviral medicine 877
## Q22_8_Take no action to treat the illness 839
## Q22_9_Other 38
q22 <- Q22 %>%
count(q, r)
Q23. Which of the following actions do you take when you have influenza symptoms to avoid someone else from getting sick?
Q23 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, 123:Q23_11_Other) %>%
gather("q", "r", 7:Q23_11_Other)
with(Q23, table(q, r))
## r
## q Always Never
## Q23_1_Stand away from people 1006 135
## Q23_10_Cover my nose and mouth when I sneeze or cough 1717 81
## Q23_11_Other 54 421
## Q23_2_Avoid public places 897 196
## Q23_3_Avoid public transportation 1342 245
## Q23_4_Stay at home 869 163
## Q23_5_Wash my hands with soap more often 1559 92
## Q23_6_Use hand sanitizers 1014 299
## Q23_7_Clean the surfaces in my home 1151 153
## Q23_8_Clean the surfaces I use at work 856 508
## Q23_9_Cover my nose and mouth with a surgical mask 267 1463
## r
## q Sometimes
## Q23_1_Stand away from people 996
## Q23_10_Cover my nose and mouth when I sneeze or cough 341
## Q23_11_Other 28
## Q23_2_Avoid public places 1044
## Q23_3_Avoid public transportation 550
## Q23_4_Stay at home 1106
## Q23_5_Wash my hands with soap more often 488
## Q23_6_Use hand sanitizers 825
## Q23_7_Clean the surfaces in my home 832
## Q23_8_Clean the surfaces I use at work 772
## Q23_9_Cover my nose and mouth with a surgical mask 409
q23 <- Q23 %>%
count(q, r)
Q26. Does your household have children?
## Q26
## No Yes
## 1570 576
ggplot(data2[!is.na(data2$Q26), ]) + geom_bar(mapping = aes(x = Q26, fill = Q26), position = position_dodge())

Q27. What actions do you take when a child in your household has influenza symptoms?
Q27 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, 159:Q27_4_Other) %>%
gather("q", "r", 7:Q27_4_Other)
with(Q27, table(q, r))
## r
## q Always Never
## Q27_1_Keep the child away from the others in the residence 198 90
## Q27_2_Keep the child out of school/daycare 377 46
## Q27_3_Stop child_s social activities like play dates 388 41
## Q27_4_Other 12 93
## r
## q Sometimes
## Q27_1_Keep the child away from the others in the residence 285
## Q27_2_Keep the child out of school/daycare 149
## Q27_3_Stop child_s social activities like play dates 144
## Q27_4_Other 12
q27 <- Q27 %>%
count(q, r)
Q28. Are you a single parent?
## Q28
## No Yes
## 490 86
ggplot(data2[!is.na(data2$Q28), ]) + geom_bar(mapping = aes(x = Q28, fill = Q28), position = position_dodge())

Q29. How do you care for a sick child?
Q29 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, 166:Q29_6_Other) %>%
gather("q", "r", 7:Q29_6_Other)
with(Q29, table(q, r))
## r
## q Always Never Sometimes
## Q29_1_A parent brings the child to work 7 438 41
## Q29_2_A parent stays home 266 27 193
## Q29_3_Another adult stays home 68 202 216
## Q29_4_Send the child to school sick 1 414 70
## Q29_5_Take the child to a relative or friends 8 292 186
## Q29_6_Other 4 76 6
q29 <- Q29 %>%
count(q, r)
Q30. How do you care for a sick child?
Q30 <- data2 %>%
select(PPGENDER, PPAGE, PPEDUC, PPETHM, PPINCIMP, PPWORK, 174:Q30_6_Other) %>%
gather("q", "r", 7:Q30_6_Other)
with(Q30, table(q, r))
## r
## q Always Never Sometimes
## Q30_1_I bring the child to work 4 77 5
## Q30_2_I stay home 34 10 42
## Q30_3_Another adult stays home 9 25 52
## Q30_4_Send the child to school sick 3 60 23
## Q30_5_Take the child to a relative or friends 7 33 46
## Q30_6_Other 1 14 3
q30 <- Q30 %>%
count(q, r)
Q31. How many hours of screen time (time spent watching television, a computer, smartphone, iPad, etc.) do you spend each day on average when you are not sick? Enter 0 if none
with(data2, summary(Q31))
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.000 2.000 4.000 4.868 6.000 24.000 52
# by gender
with(data2, by(Q31, PPGENDER, summary))
## PPGENDER: Female
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.000 2.000 4.000 4.838 6.000 21.000 21
## --------------------------------------------------------
## PPGENDER: Male
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.000 2.000 4.000 4.898 6.000 24.000 31
Q32. How many hours of screen time do you spend each day on average when you are sick? Enter 0 if none
with(data2, summary(Q32))
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.000 1.000 4.000 4.267 6.000 24.000 61
# by gender
with(data2, by(Q33, PPGENDER, summary))
## PPGENDER: Female
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1.000 2.000 2.000 2.567 3.000 9.000 8
## --------------------------------------------------------
## PPGENDER: Male
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1.000 2.000 2.000 2.594 3.000 14.000 20
Q33. How many people, including yourself, reside in your household?
with(data2, summary(Q33))
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1.00 2.00 2.00 2.58 3.00 14.00 28
# by ethnicity
with(data2, by(Q33, PPETHM, summary))
## PPETHM: 2+ Races, Non-Hispanic
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1.000 2.000 2.000 2.709 3.000 7.000 1
## --------------------------------------------------------
## PPETHM: Black, Non-Hispanic
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1.000 1.000 2.000 2.544 3.000 13.000 2
## --------------------------------------------------------
## PPETHM: Hispanic
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1.000 2.000 3.000 2.903 4.000 9.000 6
## --------------------------------------------------------
## PPETHM: Other, Non-Hispanic
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1.000 2.000 3.000 2.946 4.000 7.000 1
## --------------------------------------------------------
## PPETHM: White, Non-Hispanic
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1.000 2.000 2.000 2.509 3.000 14.000 18